<clr-modal [(clrModalOpen)]="createPermissionOpened" [clrModalSize]="'lg'">
  <h3 class="modal-title">{{permissionTitle}}</h3>
  <div class="modal-body">
    <form #permissionForm="ngForm">
      <section class="form-block">
        <div class="form-group" style="padding-left: 135px;">
          <label for="permission_name" class="col-md-3 form-group-label-override required">名称</label>
          <label for="permission_name" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid"
                 class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <input type="text" id="permission_name" [(ngModel)]="permission.name"
                   name="permission_name" size="60"
                   required
                   pattern="[a-zA-Z]([_A-Za-z0-9]*[A-Za-z0-9])?"
                   maxlength="200"
                   (keyup)='handleValidation()'>
            <span class="tooltip-content">
              名称不符合规范，验证规则[a-z]([_a-z0-9]*[a-z0-9])?
            </span>
          </label>
          <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
        </div>
        <!-- <div class="form-group" style="padding-left: 135px;"> -->
        <!--   <label for="permission_type" class="col-md-3 form-group-label-override required">资源类别</label> -->
        <!--   <label for="permission_type" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left"> -->
        <!--     <input type="text" id="permission_type"  [(ngModel)]="permission.type" -->
        <!--            name="permission_type" size="36" -->
        <!--            required -->
        <!--            maxlength="128" -->
        <!--            > -->
        <!--     <span class="tooltip-content"> -->
        <!--       资源类别不符合规范 -->
        <!--     </span> -->
        <!--   </label> -->
        <!--   <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span> -->
        <!-- </div> -->
        <div class="form-group" style="padding-left: 135px;">
          <label for="permission_comment" class="col-md-3 form-group-label-override">描述</label>
          <textarea type="text" id="permission_comment" [(ngModel)]="permission.comment"
                    name="permission_comment"></textarea>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-outline" (click)="onCancel()">取消</button>
          <button type="button" class="btn btn-primary" [disabled]="!isValid" (click)="onSubmit()">提交</button>
        </div>
      </section>
    </form>
  </div>
</clr-modal>
